package com.ivr.cm.dao.impl;

import org.apache.log4j.Logger;
import org.springframework.jdbc.core.support.JdbcDaoSupport;

import com.ivr.cm.dao.IMonitorDao;
/**
 * 监控数据库数据
 * @author liugeng
 * @date 2015-12-15
 * @version 1.0
 *
 */
public class MonitorDaoImpl extends JdbcDaoSupport implements IMonitorDao {
	private static Logger logger = Logger.getLogger(MonitorDaoImpl.class);
	/**检查数据库连接*/
	@Override
	public String checkConnetDB() {
		String sql = "select 1";
		try {
			this.getJdbcTemplate().execute(sql);
		} catch (Exception e) {
			logger.info("ivr程序连接数据库异常");
			return "2,ivr程序连接数据库异常\n";
		}
		logger.info("程序正常运行");
		return "0,程序正常运行";
	}
}
